Skip to content

Conversation

@TApplencourt
Copy link
Contributor

@TApplencourt TApplencourt commented Oct 10, 2025

cindex.py was missing support for isFunctionInlined, this PR add it.

@llvmbot llvmbot added clang Clang issues not falling into any other category clang:as-a-library libclang and C++ API labels Oct 10, 2025
@github-actions
Copy link

Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this page.

If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using @ followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers.

If you have further questions, they may be answered by the LLVM GitHub User Guide.

You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums.

@llvmbot
Copy link
Member

llvmbot commented Oct 10, 2025

@llvm/pr-subscribers-clang

Author: Thomas Applencourt (TApplencourt)

Changes

cindex.py was missing support for isFunctionInlined.

I was not able to figure out why clang_Cursor_isFunctionInlined return c_uint, but other is function return bool for the binding, so I'm doing the same here.

Regards,
Thomas


Full diff: https://github.com/llvm/llvm-project/pull/162882.diff

1 Files Affected:

  • (modified) clang/bindings/python/clang/cindex.py (+8)
diff --git a/clang/bindings/python/clang/cindex.py b/clang/bindings/python/clang/cindex.py
index 80140d2787608..015667b4decd9 100644
--- a/clang/bindings/python/clang/cindex.py
+++ b/clang/bindings/python/clang/cindex.py
@@ -2362,6 +2362,13 @@ def get_bitfield_width(self) -> int:
         """
         return conf.lib.clang_getFieldDeclBitWidth(self)  # type: ignore [no-any-return]
 
+    def is_function_inlined(self) -> bool:
+        """
+        Check if the function is inlined
+        """
+        assert self.kind == TypeKind.FUNCTIONPROTO
+        return bool(conf.lib.clang_Cursor_isFunctionInlined(self))  # type: ignore [no-any-return]
+
     @cursor_null_guard
     def has_attrs(self) -> bool:
         """
@@ -4308,6 +4315,7 @@ def set_property(self, property, value):
     ("clang_Cursor_isAnonymous", [Cursor], bool),
     ("clang_Cursor_isAnonymousRecordDecl", [Cursor], bool),
     ("clang_Cursor_isBitField", [Cursor], bool),
+    ("clang_Cursor_isFunctionInlined", [Cursor], c_uint),
     ("clang_Location_isInSystemHeader", [SourceLocation], bool),
     ("clang_PrintingPolicy_dispose", [PrintingPolicy]),
     ("clang_PrintingPolicy_getProperty", [PrintingPolicy, c_int], c_uint),

@TApplencourt
Copy link
Contributor Author

Pinging @DeinAlptraum (or at least the git blame seem to imply that you are the one in charge :) sorry if it's not the case)

@TApplencourt TApplencourt changed the title Add isFunctionInlined support in Python Binding [libclang/python] Add isFunctionInlined support Oct 10, 2025
Copy link
Contributor

@DeinAlptraum DeinAlptraum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi and thanks for the PR! Yes, I am the right person to ping for the libclang-python bindings.

Please also

  1. Add a release note (clang/docs/ReleaseNotes.rst)
  2. Add test(s) for the new function

@TApplencourt
Copy link
Contributor Author

Release note added in 6edd33c

@DeinAlptraum
Copy link
Contributor

LGTM. @Endilll do you also want to take a look at this?

Co-authored-by: Vlad Serebrennikov <[email protected]>
Copy link
Contributor

@Endilll Endilll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be merged after you update the PR description, because it goes into the commit message.

@TApplencourt
Copy link
Contributor Author

Thanks! Edited.

@Endilll Endilll merged commit 855a3e9 into llvm:main Oct 30, 2025
11 of 12 checks passed
@github-actions
Copy link

@TApplencourt Congratulations on having your first Pull Request (PR) merged into the LLVM Project!

Your changes will be combined with recent changes from other authors, then tested by our build bots. If there is a problem with a build, you may receive a report in an email or a comment on this PR.

Please check whether problems have been caused by your change specifically, as the builds can include changes from many authors. It is not uncommon for your change to be included in a build that fails due to someone else's changes, or infrastructure issues.

How to do this, and the rest of the post-merge process, is covered in detail here.

If your change does cause a problem, it may be reverted, or you can revert it yourself. This is a normal part of LLVM development. You can fix your changes and open a new PR to merge them again.

If you don't get any reports, no action is required from you. Your changes are working as expected, well done!

@llvm-ci
Copy link
Collaborator

llvm-ci commented Oct 30, 2025

LLVM Buildbot has detected a new failure on builder lldb-aarch64-windows running on linaro-armv8-windows-msvc-05 while building clang at step 6 "test".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/141/builds/12643

Here is the relevant piece of the build log for the reference
Step 6 (test) failure: build (failure)
...
UNSUPPORTED: lldb-api :: commands/frame/diagnose/local-variable/TestLocalVariable.py (156 of 2322)
UNSUPPORTED: lldb-api :: commands/frame/diagnose/virtual-method-call/TestDiagnoseDereferenceVirtualMethodCall.py (157 of 2322)
XFAIL: lldb-api :: commands/frame/language/TestGuessLanguage.py (158 of 2322)
PASS: lldb-api :: commands/frame/recognizer/TestFrameRecognizer.py (159 of 2322)
UNSUPPORTED: lldb-api :: commands/frame/select/TestFrameSelect.py (160 of 2322)
PASS: lldb-api :: commands/frame/var-dil/basics/AddressOf/TestFrameVarDILAddressOf.py (161 of 2322)
PASS: lldb-api :: commands/frame/var-dil/basics/ArraySubscript/TestFrameVarDILArraySubscript.py (162 of 2322)
PASS: lldb-api :: commands/frame/var-dil/basics/BitField/TestFrameVarDILBitField.py (163 of 2322)
PASS: lldb-api :: commands/frame/var-dil/basics/BitFieldExtraction/TestFrameVarDILBitFieldExtraction.py (164 of 2322)
PASS: lldb-api :: commands/frame/var-dil/basics/GlobalVariableLookup/TestFrameVarDILGlobalVariableLookup.py (165 of 2322)
FAIL: lldb-api :: commands/expression/test/TestExprs.py (166 of 2322)
******************** TEST 'lldb-api :: commands/expression/test/TestExprs.py' FAILED ********************
Script:
--
C:/Users/tcwg/scoop/apps/python/current/python.exe C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/llvm-project/lldb\test\API\dotest.py -u CXXFLAGS -u CFLAGS --env LLVM_LIBS_DIR=C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/./lib --env LLVM_INCLUDE_DIR=C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/include --env LLVM_TOOLS_DIR=C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/./bin --arch aarch64 --build-dir C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/lldb-test-build.noindex --lldb-module-cache-dir C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/lldb-test-build.noindex/module-cache-lldb\lldb-api --clang-module-cache-dir C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/lldb-test-build.noindex/module-cache-clang\lldb-api --executable C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/./bin/lldb.exe --compiler C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/./bin/clang.exe --dsymutil C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/./bin/dsymutil.exe --make C:/Users/tcwg/scoop/shims/make.exe --llvm-tools-dir C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/./bin --lldb-obj-root C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/tools/lldb --lldb-libs-dir C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/./lib --cmake-build-type Release --skip-category=watchpoint C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\test\API\commands\expression\test -p TestExprs.py
--
Exit Code: 1

Command Output (stdout):
--
lldb version 22.0.0git (https://github.com/llvm/llvm-project.git revision 855a3e974dfaa317d65d9e66c3cadf76d470da2b)
  clang revision 855a3e974dfaa317d65d9e66c3cadf76d470da2b
  llvm revision 855a3e974dfaa317d65d9e66c3cadf76d470da2b
Skipping the following test categories: ['watchpoint', 'libc++', 'libstdcxx', 'dwo', 'dsym', 'gmodules', 'debugserver', 'objc', 'fork', 'pexpect']


--
Command Output (stderr):
--
UNSUPPORTED: LLDB (C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\bin\clang.exe-aarch64) :: test_evaluate_expression_python_dsym (TestExprs.BasicExprCommandsTestCase.test_evaluate_expression_python_dsym) (test case does not fall in any category of interest for this run) 

FAIL: LLDB (C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\bin\clang.exe-aarch64) :: test_evaluate_expression_python_dwarf (TestExprs.BasicExprCommandsTestCase.test_evaluate_expression_python_dwarf)

UNSUPPORTED: LLDB (C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\bin\clang.exe-aarch64) :: test_evaluate_expression_python_dwo (TestExprs.BasicExprCommandsTestCase.test_evaluate_expression_python_dwo) (test case does not fall in any category of interest for this run) 

UNSUPPORTED: LLDB (C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\bin\clang.exe-aarch64) :: test_expr_commands_can_handle_quotes_dsym (TestExprs.BasicExprCommandsTestCase.test_expr_commands_can_handle_quotes_dsym) (test case does not fall in any category of interest for this run) 

PASS: LLDB (C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\bin\clang.exe-aarch64) :: test_expr_commands_can_handle_quotes_dwarf (TestExprs.BasicExprCommandsTestCase.test_expr_commands_can_handle_quotes_dwarf)

UNSUPPORTED: LLDB (C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\bin\clang.exe-aarch64) :: test_expr_commands_can_handle_quotes_dwo (TestExprs.BasicExprCommandsTestCase.test_expr_commands_can_handle_quotes_dwo) (test case does not fall in any category of interest for this run) 

UNSUPPORTED: LLDB (C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\bin\clang.exe-aarch64) :: test_floating_point_expr_commands_dsym (TestExprs.BasicExprCommandsTestCase.test_floating_point_expr_commands_dsym) (test case does not fall in any category of interest for this run) 

XFAIL: LLDB (C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\bin\clang.exe-aarch64) :: test_floating_point_expr_commands_dwarf (TestExprs.BasicExprCommandsTestCase.test_floating_point_expr_commands_dwarf)

UNSUPPORTED: LLDB (C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\bin\clang.exe-aarch64) :: test_floating_point_expr_commands_dwo (TestExprs.BasicExprCommandsTestCase.test_floating_point_expr_commands_dwo) (test case does not fall in any category of interest for this run) 

UNSUPPORTED: LLDB (C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\bin\clang.exe-aarch64) :: test_many_expr_commands_dsym (TestExprs.BasicExprCommandsTestCase.test_many_expr_commands_dsym) (test case does not fall in any category of interest for this run) 


luciechoi pushed a commit to luciechoi/llvm-project that referenced this pull request Nov 1, 2025
`cindex.py` was missing support for
[isFunctionInlined](https://clang.llvm.org/doxygen/group__CINDEX__TYPES.html#ga963097b9aecabf5dce7554dff18b061d),
this PR add it.

---------

Co-authored-by: Vlad Serebrennikov <[email protected]>
DEBADRIBASAK pushed a commit to DEBADRIBASAK/llvm-project that referenced this pull request Nov 3, 2025
`cindex.py` was missing support for
[isFunctionInlined](https://clang.llvm.org/doxygen/group__CINDEX__TYPES.html#ga963097b9aecabf5dce7554dff18b061d),
this PR add it.

---------

Co-authored-by: Vlad Serebrennikov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:as-a-library libclang and C++ API clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants